<template>
    <div class="citylist" ref="wrapper">
        <div>
            <div class="area">
                <div class="title border-topbottom">当前城市</div>
                <div class="button-list">
                    <div class="button-wrapper">
                        <div class="button">北京</div>
                    </div>
                </div>
            </div>
            <div class="area">
                <div class="title border-topbottom">热门城市</div>
                <div class="button-list">
                    <div class="button-wrapper" v-for="(item, key) of hotCities" :key="key">
                        <div class="button">{{ item.name }}</div>
                    </div>
                </div>
            </div>
            <div class="area" v-for="(item, key) of cities" :key="key">
                <div class="title border-topbottom">{{ key }}</div>
                <div class="item-list">
                    <div class="item" v-for="innerItem of item" :key="innerItem.id">
                        {{ innerItem.name }}
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import BScroll from 'better-scroll';

export default {
    name: 'CityList',
    props: {
        hotCities: Array,
        cities: Object,
    },
    data() {
        return {};
    },
    mounted() {
        this.scroll = new BScroll(this.$refs.wrapper);
    },
};
</script>

<style lang="stylus" scoped>
@import '~@/assets/styles/varibles.styl'
  .border-topbottom
    &:before
      border-color : #ccc
    &:after
      border-color : #ccc
  .citylist
    overflow hidden;
    position absolute;
    left 0;
    right 0;
    top 1.34rem;
    bottom 0;
    width 100%;
    .title
      font-size: .24rem;
      padding: .2rem .3rem;
      background #eee;
    .button-list
      overflow hidden;
      padding .1rem .5rem .1rem .1rem;
      .button-wrapper
        float left
        width 33.33%;
        .button
          text-align center;
          margin .1rem;
          line-height .44rem;
          border: .05rem solid #ccc;
          border-radius .09rem;
    .item-list
      &:before
        border-color : #ccc
      &:after
        border-color : #ccc
      .item
        line-height .5rem;
        padding 0 0 0 .2rem;
</style>
